import os
import zipfile


def zip_file(dir_path, out_filename):
    testcase_zip = zipfile.ZipFile(out_filename, 'w', zipfile.ZIP_DEFLATED)
    for path, _, file_names in os.walk(dir_path):
        for filename in file_names:
            file_path = os.path.join(path, filename)
            if 'image' not in file_path and 'zip' not in file_path :
                testcase_zip.write(file_path)
    testcase_zip.close()